home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dirut / wild15.zip / WILDUNIX.DOC < prev   
Text File  |  1989-07-25  |  5KB  |  99 lines

  1.     WILDUNIX.COM (Version 1.5) - UN*X STYLE PATTERN MATCHER
  2.         -----------------------------------------
  3.  
  4.  
  5. Wildunix is a TSR which intercepts INT 21 functions 4E and 4F, the DOS
  6. 'Find First' and 'Find Next' pattern matching routines. It implements a
  7. UN*X style pattern matching algorithm instead of DOS's.
  8.  
  9. There are no command-line arguments: to run, just type 'wildunix'.
  10. As with most TSR utilities, it's best to have it loaded by the
  11. 'autoexec.bat' file.
  12.  
  13. 'Wildunix' will resist attempts to load multiple copies of itself.
  14.  
  15. The parameters to the modified functions (and returned values) are intended
  16. to match the original *documented* specification as nearly as possible. Due
  17. to some inconsistency around DOS version 3.1 concerning the contents of the
  18. 'undocumented' part of the info returned in the DTA, 'Wildunix' will only
  19. run on DOS 3.20 and above. Applications that make use of the *undocumented*
  20. part of the DTA will likely crash if 'Wildunix' is running.
  21.  
  22. Accepted wildcards:
  23. *        Matches any string (including none)
  24. ?        Matches any single character
  25. [list]        Matches any character that satisfies the items in the list
  26.         The list may consist of:
  27.         1) Single characters    or
  28.         2) Two characters separated by a minus sign, meaning 'match
  29.         a character whose ASCII value lies between the two limits'.
  30.  
  31. Differences between UN*X's pattern-matching and this TSR's version:
  32. 1) The pattern given may not contain more than 15 characters.
  33. 2) The patterns '*' and '*.*' do the same thing (special case). This is because
  34.     many MSDOS utilities search a directory by specifying '*.*'. Strict
  35.     UN*X pattern matching would only find filenames with a dot in them, but
  36.     as that would break some MSDOS routines, it's been kludged. If you
  37.     really want to match only files with '.' in them, try '*[.]*'
  38. 3) A wild-pattern passed to a utility on the command-line may fail strangely
  39.     if the ONLY wildcards used are '[' and ']'. This is not the fault of
  40.     'Wildunix', it's because many DOS utilities choose whether or not to
  41.     call functions 4E and 4F depending on whether *they* think you've
  42.     used wildcards or not. Needless to say, no test is made for '[' and ']'.
  43.     You can get round this by putting a spurious '*' at the end of the
  44.     pattern (it will match the null string and have no effect other than
  45.     to force the utility to call functions 4E and 4F).
  46.  
  47.     -------------------------------------------------------
  48.  
  49.  
  50.  
  51.     Changes to the specification of INT 21, Functions 4E and 4F.
  52.  
  53. The first 12 bytes of the 'undocumented' area of the DTA will not be as
  54. you expect. They will contain a 'packed' wildcard string which will be
  55. unpacked and used by the next call to 'Find Next'. This was neccessary in order
  56. to allow 15-characters in wildcard specifications. With the advent of the
  57. "[<list>]" construction, 11 (as used in MSDOS) was insufficient.
  58.  
  59. The packing algorithm maps those ASCII chars legal in filenames to a 6-bit
  60. representation, then packs 16 6-bit numbers into 12 bytes. In DOS format, byte
  61. 0 of the undocumented area is the drive-no for the search, this is truncated
  62. to 6-bits, and becomes the 16th packed character. (That's why there's only
  63. space for 15 chars of pattern).
  64.  
  65. The mapping of ASCII to 6-bit is as follows:
  66. Ascii NULL            -> $00
  67. Ascii '!' thru '9'        -> $01 thru $19
  68. Ascii '\'            -> $1A
  69. Ascii '{' thru '~'        -> $1B thru $1E
  70. Ascii '?' thru '_'        -> $1F thru $3F
  71. Ascii 'a' thru 'z'        -> $21 thru $3A    (ucase & lcase map the same)
  72.  
  73.     --------------------------------------------------
  74.  
  75. Under consideration:
  76. 1)    Arranging to intercept functions 11H, 12H and 29H - the FCB orientated
  77.     wildcard matcher routines. (Thanks to Russ Nelson for the idea). This
  78.     *may* make DIR and some other old-fashioned Microsoft utilities take
  79.     UN*X wild cards properly.
  80.  
  81. 2)    Arranging for the command 'wildunix -f' to switch off the TSR, and
  82.     for 'wildunix -n' to switch it back on again, so that utilities which
  83.     object to 'wildunix' can run without trouble. BACKUP and/or RESTORE
  84.     seem to be examples of this problem.
  85.  
  86. (c) Steve Hosgood & Terry Barnaby 1989.
  87. Permission is granted for noncommercial use of this documentation and the
  88. associated software. No guarantees are given or to be implied. If the program
  89. works, that's fine, if not, chuck it.
  90.  
  91. This documentation and associated software may be freely copied within the
  92. noncommercial domain as long as no charge is made and the copyright notices
  93. remain intact.
  94.  
  95. The authors will accept no liability for death, injury, lost Mars probes or
  96. anything else.
  97.  
  98. Enquiries, comments, donations (!) etc to: iiit-sh@pyr.swan.ac.uk
  99.